﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Manager;


namespace ClassLibrary1
{
    public class binContacts
    {
        
        private DbManager db;

        public binContacts()
        {
            db = new DbManager();
        }

        public DataTable getProvices()
        {
            DataTable list = new DataTable();
            list = db.getData("Select * From Provices");
            return list;
        }
        public DataTable getTeams()
        {
            DataTable list = new DataTable();
            list = db.getData("select * from Teams");
            return list;
        }
        public DataTable getContacts()
        {
            DataTable list = new DataTable();
            list = db.getData("select * from Contacts");
            return list;
        }
        
        //public bool editContacts(int id, int IDTeam, string IDProvices, string FullName, Boolean Gender, string CompanyName, string Position, string Address, string Telephone, string Email, string Website, string MainContent, int Reader)
        //{
        //    SqlParameter[] param = {
        //                               new SqlParameter("contact", id),

        //                               new SqlParameter("idteam", IDTeam),
        //                               new SqlParameter("idpro", IDProvices),
        //                               new SqlParameter("name", FullName),
        //                               new SqlParameter("gt", Gender),
        //                               new SqlParameter("cty", CompanyName),
        //                               new SqlParameter("vitri", Position),
        //                               new SqlParameter("dchi", Address),
        //                               new SqlParameter("sdt", Telephone),
        //                               new SqlParameter("email", Email),
        //                               new SqlParameter("web", Website),
        //                               new SqlParameter("ndung", MainContent),
        //                               new SqlParameter("rea", Reader),
                                       
        //                           };
        //    try
        //    {
        //        db.changeData("Update Contacts set FullName = @name where  ContactsID = @contact, IDTeam = @idteam, IDProvices = @idpro, Gender = @gt, CompanyName = @cty, Position = @vitri, Address = @dchi, Telephone = @sdt, Email = @email, Website = @web, MainContent = @ndung, Reader = @rea ", param);
        //        return true;
        //    }
        //    catch (Exception)
        //    {
        //        return false;
        //        throw;
        //    }



        //}

    }   

    
}
